<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" href="css/common.css" type="text/css" />
        <link href="css/adminstyle.css" rel="stylesheet" type="text/css">
        <title> <?=Common::_t('page_admin_area')?></title>
        <script src="js/js.js">        </script>
        <script language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"> </script>
         <?$page_message = Common::_t('page_message');?>
        <script>
            function delc(id) {
                if (confirm('<?=getStr($page_message, 'page_message_1')?>')) {
                    location.href = 'teacher_delete.html?id=' + id;
                }
            }
            function submits1(action) {
                var check_flg = false;
                $("input:checkbox[name='id[]']:checked").each(function() {
                    check_flg = true;
                })
                if (check_flg == true) {
                    document.getElementById('form').action = action;
                    document.getElementById('form').submit();
                } else {
                    alert('<?=getStr($page_message, 'page_message_2')?>');
                }
            }
        </script>
    </head>
    <?$page_th = Common::_t('page_th');?>
    <?$page_selected = Common::_t('page_select');?>
    <?$page_search = Common::_t('page_search');?>
    <?$page_back = Common::_t('page_back');?>
    <?$page_add = Common::_t('page_add');?>
    <?$page_operation = Common::_t('page_operation');?>
    <body>
        <div id="man_zone">
            <div style="background-color:#FFFFFF ">
                <div class="search_condition">
                    <div style="margin-top:10px;margin-bottom:10px;">
                        <form method="get" action="teacher_lists.html" id="searchForm">
                            		<?=getStr($page_th, 'name')?>
                            <input name="name" type="text" value="<?=getParamValue('name')?>" />
                            &nbsp;<?=getStr($page_th, 'teacher_no')?>
                            <input name="serial_number" type="text" value="<?=getParamValue('serial_number')?>" />
                            &nbsp;<?=getStr($page_th, 'sex')?>
                            <select name="sex">
                                <option value="">
                                  <?=$page_selected?>
                                </option>
                                <? echo $sexOption; ?>
                            </select>
                            &nbsp; <?=getStr($page_th, 'status')?>
                            <select name="status">
                                <option value="">
                                   	<?=$page_selected?>
                                </option>
                                <?echo $statusOption; ?>
                            </select>
                            &nbsp; <?=getStr($page_th, 'contract_type')?>
                            <select name="contract_category">
                                <option value="">
                                    	<?=$page_selected?>
                                </option>
                                <?echo $contractCategoryOption; ?>
                            </select>
                            &nbsp;
                            <input type="hidden" name="pxh_flg" value="sort_desc" id="pxh_flg" >
                            <input class="PublicBot" name="search" type="submit" value="<?=$page_search?>" />
                            &nbsp;
                             <?if($_SESSION['admin']['admin_type']==ADMIN_TYPE_EMPLOYEE){ ?>
                            <input class="PublicBot" name="add" type="button" onclick="window.location.href='teacher_add.html'"
                            value="<?=$page_add?>" />
                            <?}?>
                        </form>
                    </div>
                </div>

                <br>
                <form method="get" id="form" action="">
                    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"
                    class="tableborder">
                        <tr class="header">
                            <td width="7%">
                            </td>
                            <td width="7%">
                               <?=getStr($page_th,'name')?> 
                            </td>
                            <td width="10%">
                              <?=getStr($page_th,'teacher_no')?>
                            </td>
                            <td width="10%">
                                <?=getStr($page_th,'country')?>
                            </td>
                            <td width="10%">
                               <?=getStr($page_th,'status')?> 
                            </td>
                            <td width="7%">
                                <?=getStr($page_th,'follower')?>
                            </td>
                            <td width="10%">
                            	<a href="javaScript:void(0)" class="pxh_sort" id="sort_asc"><font color="red">&nbsp;↑&nbsp;</font></a>
                                <?=getStr($page_th,'pxh')?>
                                <a href="javaScript:void(0)" class="pxh_sort" id="sort_desc"><font color="red">&nbsp;↓&nbsp;</font></a>
                            </td>
                            <td width="6%">
                                <?=getStr($page_th,'sex')?>
                            </td>
                            <td width="6%">
                                <?=getStr($page_th,'contract_type')?>
                            </td>
                            <td width="6%">
                                <?=getStr($page_th,'network_stat')?>
                            </td>
                            <td align="center" wdith="25%">
                               <?=$page_operation?>
                            </td>
                        </tr>
                        <? foreach($list as $v){ ?>
                            <tr bgcolor="#FFFFFF">
                                <td align="center">
                                    <input type="checkbox" name="id[]" id="checkbox" value="<?=$v['id']?>">
                                </td>
                                <td align="center">
                                    <?=$v[ 'name']?>
                                </td>
                                <td align="center">
                                    <?=$v[ 'serial_number']?>
                                </td>
                                <td align="center">
                                    <?=getStr($nationality,$v[ 'nationality'])?>
                                </td>
                                <td align="center">
                                    <?=getStr($teacher_status,$v[ 'status'])?>
                                </td>
                                <td align="center">
                                    <a href="teacher_managementInfo.html?employeesId=<?=$v['employees_id']?>">
                                        <?=getStr($employee_pairs,$v[ 'employees_id'])?>
                                    </a>
                                </td>
                                <td align="center">
                                    <input type="text" name="pxh" id="pxh" value="<?=$v['pxh']?>" id2="<?=$v['id']?>" size="1"/>
                                </td>
                                <td align="center">
                                    <?=getStr($sex,$v[ 'sex'])?>
                                </td>
                                <td align="center">
                                    <?=getStr($contract_category,$v[ 'contract_category'])?>
                                </td>
                                <td align="center">
                                    <?=getStr($network_stat,$v['network_stat'])?>
                                </td>
                                <td align="center">
                                	<?if($_SESSION['admin']['eo_admin_group']==ADMIN){?>
                                    <a onclick="delc('<?=$v['id']?>')" href="javascript:void(0);"  style="display: none" >
                                      		<?=Common::_t('page_del')?>
                                    </a>
		               	                     <a href="teacher_add.html?id=<?=$v['id']?>">
		                                        	<?=Common::_t('page_edit')?>
		                                    </a>
		               	                     <a href="teacher_add.html?id=<?=$v['id']?>">
		                                        	<?=Common::_t('page_info')?>
		                                     </a>
                                    　						<?}else{?>
          	 						 <?if($_SESSION['admin']['admin_type']==ADMIN_TYPE_EMPLOYEE){ ?>
	               	                     <a href="teacher_add.html?id=<?=$v['id']?>">
	                                        	<?=Common::_t('page_edit')?>
	                                    </a>
                                      <?}else{?>
	               	                     <a href="teacher_add.html?id=<?=$v['id']?>">
	                                        	<?=Common::_t('page_info')?>
	                                     </a>
                                      <?}?>                                   　   	
                                    
                                    　  				 <?}?>
                                     <?if($_SESSION['admin']['admin_type']==ADMIN_TYPE_EMPLOYEE){ ?>
                                    <a href="finance_add.html?teacherId=<?=$v['id']?>">
                                       	<?=getStr($page_th, 'finace_set')?>
                                    </a>
                                    <?}?>
                                    <a href="teacher_courseArrangementManager.html?teacherId=<?=$v['id']?>">
                                        	<?=getStr($page_th, 'open_class_set')?>
                                    </a>
                                    <a href="teacher_course.html?teacherId=<?=$v['id']?>"> <?=getStr($page_th, 'check_class_set')?> </a>
                                    <?if($_SESSION['admin']['eo_admin_group']==ADMIN){?>
                                   		 <a href="TeacherLog_lists.html?teacher_id=<?=$v['id']?>"> <?=getStr($page_th, 'salary_set')?></a>
                                    <?}?>
                                </td>
                            </tr>
                            <? } ?>
                                <tr bgcolor="#FFFFFF">
                                    <td align="center">
                                        <input type="checkbox" name="chkall" id="checkbox" onClick="CheckAll(this.form)">
                                    </td>
                                    <td colspan="10">
                                        &nbsp;&nbsp;&nbsp;
                                         <?if($_SESSION['admin']['admin_type']==ADMIN_TYPE_EMPLOYEE){ ?>
	                                        <input type="button" class="PublicBot" name="delete" id="button" value="<?=getStr($page_th, 'follower_set')?>"    onClick="submits1('teacher_updateManagement.html')">&nbsp;&nbsp;
	                                        <input type="button" class="PublicBot" name="delete" id="button" value="<?=Common::_t('page_del')?>"  style="display: none"    onClick="submits1('teacher_delete.html')">
                                        <?}?>
                                        &nbsp;&nbsp;&nbsp;<? echo $page; ?>
                                        
                                    </td>
                                </tr>
                    </table>
                </form>
            </div>
        </div>
    </body>
<script>
   var updatePxh = new Object();

   $("input[name='pxh']").bind("change",function(){
	   var id = $(this).attr("id2");
	   var pxh= $(this).val();
	   var postJsondata ={"id":id,"pxh":pxh};
		$.ajax({
			 type:'POST',
			 url:'teacher_subUpdatePxh.html',
			 data:postJsondata,
			 dataType: 'json',
			 success:updatePxh.response,
			 async:false
		 });		   
	})	;   
	
   updatePxh.response = function(res){
		if(res.success=='fail'){
			alert('更新失败');
		}
   }

  $(".pxh_sort").bind("click",function(){
	    var pxh_flg = $(this).attr("id")
	    $("#pxh_flg").attr("value",pxh_flg);
	    $("#searchForm").submit();
  })   

   </script>       
</html>